from openpyxl import load_workbook

wb = load_workbook("InputData.xlsx")
# print(wb.sheetnames)
ws = wb.worksheets[0]
wx = wb.worksheets[1]

# print(ws["P"].value)
# print(wx["H"].value)
# TypeMap={"00":"00","02":"00","20":"00",}
for i in range(249):
    # print(ws["P%d"%(i+2)].value)
    PT = ws["P%d" % (i + 2)].value[0:2]
    # print(ws["P%d" % (i + 2)].value[2])
    tempType = []
    if (PT == "00"):
        tempType.append("00" + ws["P%d" % (i + 2)].value[2])
        tempType.append("02" + ws["P%d" % (i + 2)].value[2])
        tempType.append("20" + ws["P%d" % (i + 2)].value[2])
        tempType.append("22" + ws["P%d" % (i + 2)].value[2])
    else :
        if (PT == "01"):
            tempType.append("01" + ws["P%d" % (i + 2)].value[2])
            tempType.append("21" + ws["P%d" % (i + 2)].value[2])
            tempType.append("02" + ws["P%d" % (i + 2)].value[2])
            tempType.append("22" + ws["P%d" % (i + 2)].value[2])
        else:
            if (PT == "10"):
                tempType.append("10" + ws["P%d" % (i + 2)].value[2])
                tempType.append("12" + ws["P%d" % (i + 2)].value[2])
                tempType.append("20" + ws["P%d" % (i + 2)].value[2])
                tempType.append("22" + ws["P%d" % (i + 2)].value[2])
            else:
                if (PT == "11"):
                    tempType.append("11" + ws["P%d" % (i + 2)].value[2])
                    tempType.append("21" + ws["P%d" % (i + 2)].value[2])
                    tempType.append("12" + ws["P%d" % (i + 2)].value[2])
                    tempType.append("22" + ws["P%d" % (i + 2)].value[2])

    desList = []
    # print(tempType)
    for i in range(69):
        for j in tempType:
            if (wx["H%d" % (i + 2)].value == j):
                desList.append(i+1)
    print(desList)
